import { getLayoutProps } from "@/common/layout/getProps";
import { DeleteOutlined, DownloadOutlined, EditOutlined, PlusOutlined } from "@ant-design/icons";
import { PageContainer } from "@ant-design/pro-layout";
import Router from "next/router";
import type { TabsProps
} from "antd";
import {
  Tabs
} from "antd";
import {
  Button,
  Col,
  DatePicker,
  Form,
  Input,
  InputNumber, message, Modal,
  Row, Select, Space,
  Table,
  type TableColumnsType,
  type TableProps
} from "antd";
import dayjs from "dayjs";
import { useRouter } from "next/router";
import { type Key, useEffect, useState } from "react";
import GlobalClasses from "@/styles/globalClasses.module.scss";
import styles from "./index.module.scss";
import { http } from "@/utils/request";
import { cloneDeep } from "lodash";

type TableRowSelection<T> = TableProps<T>["rowSelection"];

const { confirm } = Modal;
type TableDataType = {
  field1: string;
  field2: string;
  field3: string;
  field4: string;
  field5: string;
  field6: string;
  field7: string;
  field8: string;
  field9: string;
}
interface EditTableProps {
  personInfo: any;
}
export const DepartmentAppraiseCU = () => {
  const { TextArea } = Input;
  const router = useRouter();
  const { query } = router;
  const { id, type } = query;
  const [form] = Form.useForm();
  // const [pmEvaluObjectTargetQueries, setEditTableData] = useState<Partial<Record<string, any>>[]>([]);
  const [pmEvaluObjectItemQueries, setPmEvaluObjectItemQueries] = useState<Partial<Record<string, any>>[]>([]);
  const [editForm] = Form.useForm()
  const [open, setOpen] = useState<boolean>(false);
  const [currentEdit, setCurrentEdit] = useState<Partial<TableDataType>>({});
  const [evaluPersionType,setEvaluPersionType] = useState(1)
  const [selectedRowKeys, setSelectedRowKeys] = useState<Key[]>([])
  const [projectList,setProjectList] = useState([]);
  const [projectName,setProjectName] = useState('');
  const [projectCode,setProjectCode] = useState('');
  const [evaluPlanId,setEvaluPlanId] = useState();
  const [totalScore,setTotalScore] = useState();//总分上限
  const [employeeList,setEmployeeList] = useState([]);
  const [employeeIndex,setEmployeeIndex] = useState(0);
  const [editingValue, setEditingValue] = useState('');

  const isAdd = !id && !type;
  const isEdit = !!id && !type;
  const isDetail = !!id && (type === "detail");

  const editTableColumns: TableColumnsType = [
    {
      align: "center",
      title: "序号",
      width: 60,
      key: "index",
      render: (_text: string, _record, index: number) => {
        return index + 1
      }
    },
    {
      align: "center",
      title: "指标类型名称",
      width: 150,
      dataIndex: "targetTypeName"
    },
    {
      align: "center",
      title: "指标名称",
      width: 150,
      dataIndex: "targetName"
    },
    {
      align: "center",
      title: "指标定义",
      width: 200,
      dataIndex: "targetContent"
    },
    {
      align: "center",
      title: "考评标准",
      width: 200,
      dataIndex: "standard"
    },
    {
      align: "center",
      title: "权重(%)",
      width: 120,
      dataIndex: "targetWeight"
    }
  ]
  const editColumns = [
    {
      align: "center",
      title: "自评得分",
      fixed: 'right',
      width: 100,
      dataIndex: "selfScore",
      render: (i,record) => {
        return (
          <>
          {isDetail&&<span>{record.selfScore}</span>}
          {!isDetail&&
            <InputNumber className={'w-full'} placeholder="请输入" value={record.selfScore} min={0} onBlur={(e) => {
              employeeList[employeeIndex].pmEvaluObjectTargetQueries.map((item) => {
                if(item.id == record.id){
                  item.selfScore = e.target.value
                  item.targetScore = indicatorScore(e.target.value,item.targetWeight);
                  return item;
                }
                return item;
              });
              const arr = cloneDeep(employeeList)
              setEmployeeList(arr);
              finalScore();
            }}/>
          }
          </>
        )
      }
    },
    {
      align: "center",
      title: "自评得分说明",
      fixed: 'right',
      width: 200,
      dataIndex: "selfDesc",
      render: (_,record) => {
        return (
          <>
          {isDetail&&<span>{record.selfDesc}</span>}
          {!isDetail&&
            <Input className={'w-full'} placeholder="请输入" defaultValue={record.selfDesc}  onBlur={(e) => {
              employeeList[employeeIndex].pmEvaluObjectTargetQueries.map((item) => {
                if(item.id == record.id){
                  item.selfDesc = e.target.value
                  return item;
                }
                return item;
              });
              const arr = cloneDeep(employeeList)
              setEmployeeList(arr);
            }}/>
          }
          </>
        )
      }
    },
    {
      align: "center",
      title: "指标得分",
      fixed: 'right',
      width: 100,
      dataIndex: "targetScore",
    },
  ]
  const applicationColumns: TableColumnsType = [
    {
      align: "center",
      title: "序号",
      width: 60,
      key: "index",
      render: (_text: string, _record, index: number) => {
        return index + 1
      }
    },
    {
      align: "center",
      title: "项目名称",
      dataIndex: "itemName"
    },
    {
      align: "center",
      title: "项目内容",
      dataIndex: "itemDesc"
    },
    {
      align: "center",
      title: "完成情况",
      dataIndex: "finishDesc"
    },
    {
      align: "center",
      title: "表彰情况",
      dataIndex: "praiseDesc"
    },
    {
      align: "center",
      title: "申请分数",
      dataIndex: "reqScore"
    },
    {
      align: "center",
      title: "申请说明",
      dataIndex: "reqDesc"
    }
  ]
  const operateColumns:TableColumnsType = [
    {
      title: "操作",
      width:200,
      align:'center',
      render: (_, record,index) => {
        return (
          <>
            <Button type={'link'} onClick={()=>{
              editForm.resetFields();
              const newObj = JSON.parse(JSON.stringify(record));
              setCurrentEdit(newObj);
              getProjectItem();
              setEditIndex(index);
              editForm.setFieldsValue(pmEvaluObjectItemQueries.find(item => (item.itemName === record.itemName))!)
              setOpen(true);
            }}>编辑</Button>
            <Button type={'link'} danger onClick={()=>{
              if(isEdit){
                confirm({
                  title: '提示?',
                  content: '此操作将永久删除该数据，是否继续?',
                  onOk() {
                    console.log(record);
                    delApplicationData(record.id);
                  },
                });
              }else{
                const newArr = JSON.parse(JSON.stringify(pmEvaluObjectItemQueries));
                newArr.splice(index,1);
                setPmEvaluObjectItemQueries(newArr);
              }
            }}>删除</Button>
          </>
        )
      }
  }]
  const EditTable: React.FC<EditTableProps> = ({ personInfo }) => {
    return (
      <>
        <Table
          // components={{
          //   body: {
          //     cell: EditableCell
          //   }
          // }}
          className={"mb-[20px]"}
          scroll={{ x: 1800 }}
          dataSource={personInfo.pmEvaluObjectTargetQueries}
          columns={editTableColumns.concat(editColumns)}
          rowKey={(record) => `${record.targetId}`}
          pagination={false}
        ></Table>
        <div className="header">
          <div className={[GlobalClasses.title, "title"].join(" ")}>加减分申请</div>
          {
            !(isAdd || isEdit) ?
              null :
              (
                <Row justify={"end"} className={"mb-[20px]"}>
                  <Button type={"link"} icon={<DownloadOutlined/>}>下载模板</Button>
                  <Button type={"link"} icon={<DownloadOutlined/>}>导入</Button>
                  <Space>
                    <Button type={'primary'} icon={<PlusOutlined />} onClick={() => {
                      editForm.resetFields();
                      setCurrentEdit({});
                      getProjectItem();
                      setOpen(true);
                    }}>新增</Button>
                  </Space>
                </Row>
              )
          }
        </div>

        {/* 加减分项申请表格明细 */}
        <Table
          className={'mb-[20px]'}
          rowKey={'itemName'}
          dataSource={personInfo.pmEvaluObjectItemQueries}
          columns={isDetail?applicationColumns:applicationColumns.concat(operateColumns)}
          pagination={false}
        ></Table>
        <div>
          <Form.Item label={'总分'}>
            <Input value={personInfo.totalScore} disabled style={{width:'30%'}}></Input>
          </Form.Item>
        </div>
      </>
    )
  }

  const items: TabsProps['items'] = employeeList.map(personInfo => ({
    key: personInfo.key,
    label: personInfo.objectName,
    children: <EditTable personInfo={personInfo}/>,
  }));

  //计算最后总分
  const finalScore = ()=>{
    let count = 0
    employeeList[employeeIndex].pmEvaluObjectTargetQueries.map(item=>{
      if(item.selfScore){
        count += item.selfScore * item.targetWeight * 0.01
      }
    })
    employeeList[employeeIndex].pmEvaluObjectItemQueries?.map(item=>{
      count += item.reqScore
    })
    employeeList[employeeIndex].totalScore = count.toFixed(2)
    const arr = cloneDeep(employeeList)
    setEmployeeList(arr);
    if(count>totalScore){
      message.error(`总分上限为${totalScore},计算得出的总分超出总分上限，请重新调整自评得分和加减分！`);
    }
    return count.toFixed(2)
  }
  //计算指标得分
  const indicatorScore = (selfScore,targetWeight)=>{
    let count = 0
    count = selfScore * targetWeight * 0.01
    return count.toFixed(1)
  }
  const delApplicationData = async(id:string)=>{
    const res = await http.delete({
      url:'/PmEvaluObjectItem/removeEvaluObjectItem',
      params:{id:id},
    })
    if(res.code == 200){
      message.success('加减分申请项删除成功!');
      getDetailsData();
    }else{
      message.error(res.msg);
    }
  }
  const onSelectChange = (keys: Key[]) => {
    console.log(keys);
    setSelectedRowKeys(keys)
  }

  const rowSelection: TableRowSelection<TableDataType> = {
    selectedRowKeys,
    onChange: onSelectChange
  }

  const submit = async() => {
    const values = await form.validateFields();
    values.evaluBeginTime = dayjs(values.evaluBeginTime).format('YYYY-MM-DD');
      values.evaluEndTime = dayjs(values.evaluEndTime).format('YYYY-MM-DD');
      switch (evaluPersionType) {
        case 1:
          values.evaluPersion = dayjs(values.evaluPersion).format('YYYY');
          break;
        case 2:
          values.evaluPersion = dayjs(values.evaluPersion).format('YYYY')+ '-Q' + dayjs(dayjs(values.evaluPersion).format('YYYY-MM-DD')).quarter()
          break;
        case 3:
          values.evaluPersion = dayjs(values.evaluPersion).format('YYYY-MM');
          break;
        default:
          break;
      }
    const formData = {
      evaluPlanId:evaluPlanId,
        ...values,
        pmEvaluationObjectQueries:employeeList
    }
    formData.pmEvaluationObjectQueries.map(item=>{
      item.totalScore = Number(item.totalScore);
      item.pmEvaluObjectTargetQueries.forEach(e => {
        e.planItemId = e.id
        e.targetWeight = Number(e.targetWeight);
        e.targetScore = Number(e.targetScore);
        if(isAdd){
          delete e.id
        }
      });
    })
    if(isAdd){
      addSave(formData)
    }
    if(isEdit){
      editSave(formData)
    }
  }
  //新增接口
  const addSave = async(formData:object) =>{
    try {
      const res = await http.post({
        url:'/PmEvaluation/addPersonUnifiedEvaluation',
        data:formData,
      })
      if(res.code == 200){
        message.success('员工统评新增成功!');
        Router.push('/performanceAppraise/employeeEvaluation');
      }else{
        message.error(res.msg);
      }
    } catch (errorInfo) {
      console.log('Failed:', errorInfo);
    }
  }
  //编辑接口
  const editSave = async(formData:object) =>{
    try {
      const res = await http.post({
        url:'/PmEvaluation/updatePmEvaluation',
        data:{id,...formData,}
      })
      if(res.code == 200){
        message.success('员工统评修改成功!');
        Router.push('/performanceAppraise/employeeEvaluation');
      }
    } catch (errorInfo) {
      console.log('Failed:', errorInfo);
    }
  }

  const handleOk = async() => {
    const values = await editForm.validateFields()
    if(values){
      values.itemName = projectName;
      values.itemCode = projectCode;
      const newData = JSON.parse(JSON.stringify(employeeList));
      if(JSON.stringify(currentEdit) === "{}"){
        newData[employeeIndex].pmEvaluObjectItemQueries.push(values);
      }else{
        for (const key in values) {
          if (key in newData[employeeIndex].pmEvaluObjectItemQueries[editIndex]) {
            newData[employeeIndex].pmEvaluObjectItemQueries[editIndex][key] = values[key];
          }
        }
      }
      setEmployeeList(newData);
      setOpen(false);
    }
  }

  const handleCancel = () => {
    setOpen(false);
  }
  //获取指标信息
  const getPlanInfo = async(evaluYear:string,evaluFrequency:string)=>{
    try {
      const res = await http.get({
        url:'/pmEvaluPlan/qryByFrequency',
        params:{evaluYear:evaluYear,evaluFrequency:evaluFrequency,evaluType:'20'}
      })
      if(res.code == 200){
        form.setFieldValue('deptLeader',res.data.length>0?res.data[0].deptLeader:'');
        setEvaluPlanId(res.data[0].id);
        setTotalScore(res.data[0].fractionMax);
        const arr = JSON.parse(JSON.stringify(res.data[0].changeItemList))
        employeeList.map(item=>{
          item.pmEvaluObjectTargetQueries = res.data.length>0?cloneDeep(arr):[]
        })
        setEmployeeList(employeeList);
      }else{
        message.error(res.msg);
      }
    } catch (errorInfo) {
      console.log('Failed:', errorInfo);
    }
  }
  //根据所选考核期间，获取开始时间和结束时间
  const getDateTime = async(options:string,params:string)=>{
    try {
      const res = await http.get({
        url:'/calculateDateTools/dateIntervalCalculate',
        params:{options:options,param:params}
      })
      if(res.code == 200){
        form.setFieldValue('evaluBeginTime',dayjs(res.data.startDateTime, 'YYYY-MM-DD'));
        form.setFieldValue('evaluEndTime',dayjs(res.data.endDateTime, 'YYYY-MM-DD'));
      }else{
        message.error(res.msg);
      }
    } catch (errorInfo) {
      console.log('Failed:', errorInfo);
    }
  }
  //获取项目下拉列表
  const getProjectItem = async()=>{
    try {
      const res = await http.get({
        url:'/PmPlusMinusScoreDictionary/qryDropDownOptions',
      })
      if(res.code == 200){
        pmEvaluObjectItemQueries.forEach(aItem => {
          res.data.forEach(bItem => {
            bItem.id = String(bItem.id)
            if (aItem.itemId == bItem.id) {
              bItem.disabled = true;
            }
          });
        });
        setProjectList(res.data.map(item=>({value:item.id,label:item.projectName,projectDescription:item.projectDescription,code:item.projectCode,disabled:item.disabled?true:false})))
      }else{
        message.error(res.msg);
      }
    } catch (errorInfo) {
      console.log('Failed:', errorInfo);
    }
  }
  // 获取部门下的所有员工
  // const getEmployeeList = async()=>{
  //   const res = await http.get({
  //     url:'/PmPositionPerson/selectUserByPosition',
  //   })
    const res = await http.post({
      url:'/BaseUser/qryStaffBaseUserByOrgId',
      data:{bizUnitId:'0001101000000000182V'}
    })
    if(res.code == 200){
      const arr = res.rows.map((item,index)=>({
        key:index,
        objectId:item.idNo,
        objectName:item.name,
        totalScore:0,
        pmEvaluObjectTargetQueries:[],
        pmEvaluObjectItemQueries:[]
      }))
      setEmployeeList(arr)
    }else{
      message.error(res.msg);
    }
  }
  //获取部门评价详情数据
  const getDetailsData =async()=>{
    try {
      const res = await http.get({
        url:'/PmEvaluation/queryEvaluationDetail',
        params:{evaluationId:id}
      })
      if(res.code == 200){
        const data = JSON.parse(JSON.stringify(res.data));
        setEvaluPlanId(data.evaluPlanId);
        data.evaluBeginTime = dayjs(data.evaluBeginTime, 'YYYY-MM-DD');
        data.evaluEndTime = dayjs(data.evaluEndTime, 'YYYY-MM-DD');
        switch (data.evaluFrequency) {
          case '10'://年
          setEvaluPersionType(1);
          data.evaluPersion = dayjs().year(Number(data.evaluPersion));
            break;
          case '20'://季度
          setEvaluPersionType(2);
          const [year, quarter] = data.evaluPersion.split('-Q');// 使用 dayjs 创建一个日期对象，并设置到季度
          data.evaluPersion = dayjs().year(Number(year)).quarter(Number(quarter));
            break;
          case '30'://月
          setEvaluPersionType(3);
          const [years, month] = data.evaluPersion.split('-');
          data.evaluPersion = dayjs().year(Number(years)).month(Number(month));
            break;
          default:
            break;
        }
        setTotalScore(data.pmEvaluationObjectVos[0].fractionMax);
        res.data.pmEvaluationObjectVos.map((item,index)=>{
          item.key = index
          item.pmEvaluObjectTargetQueries = item.pmEvaluObjectTargetVos
          item.pmEvaluObjectItemQueries = item.pmEvaluObjectItemVos
          delete item.pmEvaluObjectTargetVos
          delete item.pmEvaluObjectItemVos
        })
        setEmployeeList(res.data.pmEvaluationObjectVos)
        form.setFieldsValue(data);
      }else{
        message.error(res.msg);
      }
    } catch (errorInfo) {
      console.log('Failed:', errorInfo);
    }
  }
  useEffect(() => {
    form.setFieldValue('objectDeptName','财务部门');
    form.setFieldValue('evaluType','个人');
    if (isEdit || isDetail) {
      getDetailsData();
    } else {
      getEmployeeList();
      form.setFieldsValue({})
    }
  }, []);
  useEffect(() => {
    if(employeeList.length>0){
      finalScore();
    }
  }, [JSON.stringify(employeeList[employeeIndex]?.pmEvaluObjectItemQueries)]);
  return (
    <>
      <PageContainer header={{
        title: false
      }}>
        <div className={[styles.formCard, 'mb-[20px]'].join(' ')}>
          <div className={[GlobalClasses.title, 'title'].join(" ")}>{(isEdit && !isDetail) ? "编辑" : isAdd ? "新增" : ""}员工绩效统评考核{ isDetail ? "详情" : "" }</div>

          <Form form={form} layout={"vertical"} autoComplete="off">
            <Row>
              <Col span={6}>
                <Form.Item
                  label={"单据编号"}
                  name="code"
                >
                  <Input disabled></Input>
                </Form.Item>
                <Form.Item
                  label={"考核期间"}
                  name="evaluPersion"
                  rules={[{ required: true, message: '请选择考核期间!' }]}
                >
                  <DatePicker picker={`${evaluPersionType==1?'year':evaluPersionType==2?'quarter':'month'}`} onChange={(value)=>{
                    if(form.getFieldValue().evaluFrequency){
                      getPlanInfo(dayjs(value).format('YYYY'),form.getFieldValue().evaluFrequency)
                      switch (evaluPersionType) {
                        case 1:
                          getDateTime('YEAR',dayjs(value).format('YYYY'))
                          break;
                        case 2:
                          getDateTime('QUARTER',dayjs(value).format('YYYY')+ '-Q' + dayjs(dayjs(value).format('YYYY-MM-DD')).quarter())
                          break;
                        case 3:
                          getDateTime('MONTH',dayjs(value).format('YYYY-MM'))
                          break;
                      
                        default:
                          break;
                      }
                    }else{
                      message.error('请先选择考核频次');
                    }
                  }} disabled={isDetail}/>
                </Form.Item>
                <Form.Item
                  label={"部门总监"}
                  name="deptLeader"
                >
                  <Input disabled></Input>
                </Form.Item>
              </Col>
              <Col span={6} offset={2}>
                <Form.Item
                  label={"考核名称"}
                  name="name"
                  rules={[{ required: true, message: '请输入考核名称!' }]}
                >
                  <Input placeholder={"请输入考核名称"} disabled={isDetail}></Input>
                </Form.Item>
                <Form.Item
                  label={"评价开始日期"}
                  name="evaluBeginTime"
                  rules={[{ required: true, message: '请选择评价开始日期!' }]}
                >
                  <DatePicker disabled/>
                </Form.Item>
                <Form.Item
                  label={"所属部门"}
                  name="objectDeptName"
                >
                  <Input disabled></Input>
                </Form.Item>
              </Col>
              <Col span={6} offset={2}>
                <Form.Item
                  label={"考核频次"}
                  name="evaluFrequency"
                  rules={[{ required: true, message: '请选择考核频次!' }]}
                >
                  <Select placeholder="请选择考核频次" disabled={isDetail} onChange={(value)=>{
                    switch (value) {
                      case '10':
                        setEvaluPersionType(1)
                        break;
                      case '20':
                        setEvaluPersionType(2)
                        break;
                      case '30':
                        setEvaluPersionType(3)
                        break;
                      default:
                      break;
                    }
                    if(form.getFieldValue().evaluPersion){
                      getPlanInfo(dayjs(form.getFieldValue().evaluPersion).format('YYYY'),value)
                    }
                  }} options={[
                    { value: '10', label: '年度' },
                    { value: '20', label: '季度' },
                    { value: '30', label: '月度' },
                  ]} />
                </Form.Item>
                <Form.Item
                  label={"评价结束日期"}
                  name="evaluEndTime"
                  rules={[{ required: true, message: '请选择评价结束日期!' }]}
                >
                  <DatePicker disabled/>
                </Form.Item>
                <Form.Item
                  label={"考核类型"}
                  name="evaluType"
                >
                  <Input disabled></Input>
                </Form.Item>
              </Col>
            </Row>
          </Form>

        </div>
        <div className={styles.formCard}>
          <Tabs className={'mb-[20px]'} defaultActiveKey="0" items={items} onChange={(activeKey)=>{
            setEmployeeIndex(activeKey)
          }}/>
          {
            !(isAdd || isEdit) ?
              <Row justify={'end'}>
                <Button onClick={() => {
                  Router.push('/performanceAppraise/employeeEvaluation');
                }}>返回</Button>
              </Row>
              :
              <Row justify={'end'}>
                <Space>
                  <Button onClick={() => {
                    Router.push('/performanceAppraise/employeeEvaluation');
                  }}>取消</Button>
                  <Button>保存</Button>
                  <Button type={'primary'} onClick={submit}>提交</Button>
                </Space>
              </Row>
          }

          <Modal
            open={open}
            title={`${JSON.stringify(currentEdit) === "{}" ? "新增" : "编辑"}加减分申请`}
            afterClose={() => editForm.resetFields()}
            onOk={handleOk}
            onCancel={handleCancel}
            okText={'提交'}
            cancelText={'取消'}
            footer={(_, { OkBtn, CancelBtn }) => (
              <>
                <CancelBtn />
                <OkBtn />
              </>
            )}
          >
            <Form form={editForm} initialValues={{}} labelCol={{span: 4}} autoComplete="off">
              <Form.Item
                label={'项目名称'}
                name={'itemId'}
                rules={[{ required: true, message: '请选择项目名称!' }]}
              >
                <Select
                  placeholder={"请选择项目名称"}
                  options={projectList}
                  onChange={(value,option)=>{
                    setProjectName(option.label);
                    setProjectCode(option.code);
                    editForm.setFieldValue('itemDesc',option.projectDescription)
                    editForm.setFieldValue('finishDesc',option.projectDescription)
                    editForm.setFieldValue('praiseDesc',option.projectDescription)
                    editForm.setFieldValue('reqScore',100)
                    editForm.setFieldValue('reqDesc',option.projectDescription)
                  }}
                ></Select>
              </Form.Item>
              <Form.Item
                label={'项目内容'}
                name={'itemDesc'}
              >
                <Input disabled placeholder={"请输入项目内容"}></Input>
              </Form.Item>
              <Form.Item
                label={'完成情况'}
                name={'finishDesc'}
                rules={[{ required: true, message: '请输入完成情况!' }]}
              >
                <Input placeholder={"请输入完成情况"}></Input>
              </Form.Item>
              <Form.Item
                label={'表彰情况'}
                name={'praiseDesc'}
                rules={[{ required: true, message: '请输入表彰情况!' }]}
              >
                <Input placeholder={"请输入表彰情况"}></Input>
              </Form.Item>
              <Form.Item
                label={'申请分数'}
                name={'reqScore'}
                rules={[{ required: true, message: '请输入申请分数!' }]}
              >
                <InputNumber className={'w-full'} placeholder={"请输入申请分数"} min={0} max={100}></InputNumber>
              </Form.Item>
              <Form.Item
                label={'申请说明'}
                name={'reqDesc'}
                rules={[{ required: true, message: '请输入申请说明!' }]}
              >
                <TextArea showCount maxLength={200} placeholder="请输入申请说明" />
              </Form.Item>
            </Form>
          </Modal>
        </div>
      </PageContainer>
    </>
  )
}

export const getServerSideProps = getLayoutProps;
export default DepartmentAppraiseCU;
